#ifndef PROJECTION_GPU_H
#define PROJECTION_GPU_H

#include <cuda.h>
#include <cuda_runtime.h>
#include <opencv2\opencv.hpp>

class DimensionConvertor;

class Projection_GPU{
public:
	Projection_GPU(const int k, int width, int height, const cv::Mat intrinsic);
	~Projection_GPU();
	void					setClusterND(const float4* in);
	void					setClusterMap(const int* labels);	//assume GPU memory available
	void					setInput3Dpoints(const float3* points3d_device);
	void					PlaneProjection(float3* upsampled3d_host);	
	float3*					GetPlaneFitted3D_Device()const;
private:
	void initMemory();
	void getProjectedMap();
	void initNormalized3D();
	
	DimensionConvertor* dim;
	int k;
	int width;
	int height;
	float3*					PlaneFitted3D_Device;
	float3*					Normalized3D_Device;
	float4*					normal_device;
	const float3*			Points3D_Device;
	const int* labels_device;
};
#endif